import mongoose from "mongoose";
import { dbUri } from "@config/config.default";

import User from './user';

mongoose.connect(dbUri, { useUnifiedTopology: true, useNewUrlParser: true });

const db = mongoose.connection
db.on("error", () => console.log("mongodb 数据库连接失败"))
db.once("open", () => console.log("mongodb 数据库连接成功"))

const e = {
  User: mongoose.model("User", User)
}

export = e